package com.checker.springcloud.controller;

import com.checker.springcloud.entity.CommonResult;
import com.checker.springcloud.entity.Payment;
import com.checker.springcloud.service.PaymenFeignService;
import feign.Param;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Slf4j
public class OrederFeignController {
    @Autowired
    private PaymenFeignService paymenFeignService;

    @GetMapping("/consumer/payment/{id}")
    CommonResult<Payment> getPaymentById(@PathVariable("id") Long id) {
        return paymenFeignService.getPaymentById(id);
    }

    @GetMapping("/consumer/payment/timeout")
    public String paymentFeignTimeout() {
        return paymenFeignService.paymentFeignTimeout();
    }

}
